<script setup>
import dayjs from 'dayjs'
defineProps({
  prop: {
    type: String,
    required: true
  },
  formatTemplate: {
    type: String,
    default: 'YYYY-MM-DD HH:mm:ss'
  }
})
</script>

<template>
  <el-table-column
    :prop="prop"
    :formatter="row => row[prop] && dayjs(row[prop]).format(formatTemplate)"
    v-bind="$attrs"
  />
</template>
